package com.zjbti.myactivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class SecondActivity extends AppCompatActivity {
    TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        Intent intent=getIntent();
        String name=intent.getStringExtra("name");
        textView=findViewById(R.id.textView);
        textView.setText("获取到的数据："+name);


    }
    public void closePage(View view){
        //关闭当前页面
        Intent intent = new Intent();
        intent.putExtra("result","Hello World!");
        setResult(2,intent);
        finish();
    }
}